require 'roo'

class Spreadsheet
  attr_reader :count
  def initialize(file_path)
    @xls = Roo::Spreadsheet.open(file_path)
    @count = @xls.last_row 
  end

  #def each_sheet
  #  @xls.sheets.each do |sheet|
  #    @xls.default_sheet = sheet
  #    yield sheet
  #  end
  #end

  def each_row
    0.upto(@xls.last_row - 1) do |index|
      puts @xls.row(index)
    end
  end

  def each_column
    0.upto(@xls.last_column - 1) do |index|
      puts @xls.column(index)
    end
  end
  def getColumn(num)
    #returns all products from the spreadsheet when it is called
    @xls.column(num)
  end
end
